home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-12-01 | 1.6 KB | 37 lines | [TEXT/KEEN] |
- #$FilesInOrderTest - a little test to verify that hAWK can deal with
- #input files in specific order. It expects to be passed a list of
- #full path names for the files in the single actual input file,
- #one full path name per line. It reads in this single file, alters
- #the array of input file names to contain the list, and then removes
- #the single original input file from the list. The result is as though
- #the file names were passed along using the "MFS selected files" option
- #but in the order you wanted.
-
- #To try this out:
- #1 Select some files for multi-file operations ("searching")
- #2 Run the program $EchoFullPathNames - this will generate a list of
- # full path names for the files you selected, and show the results
- # in the window $tempStdOut
- #3 Copy the contents of $tempStdOut to a new window (no need to save it)
- # and alter the sequence of path names by swapping some lines
- #4 Leave the new window in front and run this program, taking input
- # from "All of front text". At the end, $tempStdOut will display the
- # same list as your new window. (Note $tempStdOut is automatically
- # refreshed after a run, so there is no need to close it first).
-
- #This is the modification to be added to the beginning of any program
- #that wants a list of files in specific order to use as input:
- BEGIN {while (getline _specific_file_ < ARGV[1] > 0)
- {
- if (length(_specific_file_) > 1 &&
- index(_specific_file_, ":") > 0)
- ARGV[ARGC++] = _specific_file_;
- }
- close(ARGV[1]);
- ARGV[1] = "";
- }
- #end modification
-
- #Read the files in as input, but just print out the filenames in
- #the order encountered.
- FNR == 1 {print FILENAME }